{% extends 'application.html' %}
{% block content %}
{% include '_nav.html'%}
<script type="text/javascript" charset="utf-8">
    var _site_id = {{site.id}};
</script>
<div class="row">
    <div class="span2"></div>
    <div class="span10">
        <table class="table" width="100%" border="0">
            <thead>
                <tr>
                    <th class="span2">CNAME</th>
                    <th class="span8">
                        <div class="span8">dns1.sicool.cc.
                            {% if site.is_cname == 1 %}
                            <span class="label label-success">正常</span>
                            {% else %}
                            <a href="/site/{{site.id}}/help"><span class="label label-warning">DNS记录未解析</span></a>
                            {% endif %}
                        </div>
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr height="60">
                    <td>源站</td>
                    <td>
                        <div class="span8">
                            <span class="site-host">{{site.host}}</span>
                            <a class="btn btn-mini" id="site-host-btn" href="javascript:void(0)" onclick="site_host_edit('{{site.host}}')">修改</a>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>其他域名</td>
                    <td>
                        <div class="site-domains span5">
                            <table class="table table-condensed">
                                <thead>
                                    <tr>
                                        <th class="span1">#</th>
                                        <th class="span2">域名</th>
                                        <th class="span2">操作</th>
                                    </tr>
                                    <tr>
                                        <th>{{site.id}}</th>
                                        <th>{{site.domain}}</th>
                                        <th><a class="btn btn-mini" href="/site/{{site.id}}/destory" onclick="javascript:confirm('删除不可恢复?')">删除</a></th>
                                    </tr>
                                    {% for sub in subs %}
                                    <tr>
                                        <td>{{sub.id}}</td>
                                        <td>{{sub.domain}}</td>
                                        <td>
                                            <a class="btn btn-mini" href="javascript:void(0)" onclick="site_domain_edit('{{sub.id}}')">编辑</a>
                                            <a class="btn btn-mini" href="javascript:void(0)" onclick="site_domain_delete('{{sub.id}}')">删除</a>
                                        </td>
                                    </tr>
                                    {% endfor %}
                                </thead>
                            </table>
                        </div>
                        <div class="site-domain-add span3">
                            <a href="javascript:void(0)" class="btn btn-mini" onclick="site_domain_new()">添加域名</a>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>站点缓存</td>
                    <td>
                        <div class="span8">
                            <a class="btn btn-mini" href="javascript:void(0)" onclick="site_clear_cache()">清除缓存</a>
                        </div>
                    </td>
                </tr>
                <tr height="60">
                    <td>端口</td>
                    <td>
                        <div class="span8">
                            <span class="site-port">{{site.port}}</span>
                            <a href="javascript:void(0)" class="btn btn-mini" id="site-port-btn" onclick="site_port_edit('{{site.port}}')">修改端口</a>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>当前节点</td>
                    <td>
                        <div class="site-nodes span8">
                            <table class="table-bordered">
                                <thead>
                                    <tr>
                                        <th class="span1">#</th>
                                        <th class="span2">节点IP</th>
                                        <th class="span2">今日流量</th>
                                        <th class="span2">操作</th>
                                    </tr>
                                </thead>
                                <body>
                                    {% for node in nodes %}
                                    <tr>
                                        <td>{{node.id}}</td>
                                        <td><a href="/site/{{site.id}}/{{node.nid}}/traffic">节点#{{node.nid}}</td>
                                        <td>12.45M</td>
                                        <td>
                                            <a href="javascript:void(0)" class="btn btn-mini">停止</a>
                                            <a href="javascript:void(0)" class="btn btn-mini">删除</a>
                                        </td>
                                    </tr>
                                    {% endfor %}
                                </body>
                            </table>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
{% endblock %}
